/**
 * Copyright (c) OpenLens Authors. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */

import { Renderer } from "@k8slens/extensions";
import React from "react";

import { ValidatingWebhookConfigurationPage, ValidatingWebhookConfigurationIcon } from "./src/ValidatingWebhookConfiguration";
import { MutatingWebhookConfigurationPage, MutatingWebhookConfigurationIcon } from "./src/MutatingWebhookConfiguration";

export default class WebhookAdmissionExtension extends Renderer.LensExtension {

  clusterPages = [{
    id: "validatingWebhookConfiguration",
    components: {
      Page: () => <ValidatingWebhookConfigurationPage extension={this} />,
      MenuIcon: ValidatingWebhookConfigurationIcon,
    }
  },{
    id: "mutatingWebhookConfiguration",
    components: {
      Page: () => <MutatingWebhookConfigurationPage extension={this} />,
      MenuIcon: MutatingWebhookConfigurationIcon,
    }
  }]

  clusterPageMenus = [
    {
      target: { pageId: "mutatingWebhookConfiguration" },
      title: "MutatingWebhookConfiguration",
      components: {
        Icon: MutatingWebhookConfigurationIcon,
      }
    },
    {
      target: { pageId: "validatingWebhookConfiguration" },
      title: "ValidatingWebhookConfiguration",
      components: {
        Icon: ValidatingWebhookConfigurationIcon,
      }
    },
  ];
}